package com.yimi.policyservice.controller;

import com.yimi.policyservice.entity.base.system.SysDataDict;
import com.yimi.policyservice.service.DictService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * 数据字典
 */
@RestController
@RequestMapping(value = "dict")
public class DataDictController {

    @Autowired
    private DictService dictService ;

    @RequestMapping("")
    public List<SysDataDict> getAll(String key){
        return  dictService.findByKey(key);
    }

    @RequestMapping("all")
    public Map getAllCode(){
        return dictService.getAllCode();
    }


}
